package edu.tjut.cs;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;

@SpringBootApplication
@Import({SwaggerConfig.class})
public class Test4Application implements CommandLineRunner {
/*	@Autowired
	private CustomerDao customerDao;
	@Autowired
	private ProductDao productDao;*/
	
	public static void main(String[] args) {
		SpringApplication.run(Test4Application.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
/*		Faker faker = Faker.instance(Locale.CHINA);
		System.out.println("------------ 添加顾客 --------------");
		for (int i = 0; i < 10; i++) {
			String name = faker.name().fullName();
			Customer customer = new Customer(name, new Email(faker.internet().emailAddress(name)), new Money(faker.number().numberBetween(0, 10000)));
			customer.addAddress(new Address(faker.address().streetAddress(), faker.address().cityName()));
			customerDao.save(customer);
		}
		System.out.println("------------ 添加商品 --------------");
		for (int i = 0; i < 10; i++) {
			Commerce commerce = faker.commerce();
			Product product = new Product(commerce.productName(), new BigDecimal(commerce.price()));
			product.getAttributes().put("color", commerce.color());
			product.getAttributes().put("material", commerce.material());
			productDao.save(product);
		}*/
	}
}
